<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算属性</title>
  <script type="text/javascript" src="vue.js"></script>
</head>
<body>
      <div id="app">
        {{fullName}}
        {{age}}
      </div>

      <script>
        var  vm  =  new Vue({
            el:'#app',
            data:{
              firstName:'ming',
              lastName:'zhou',
              age:25
            },
          //方法
         /* methods:{
            fullName:function () {
              return  this.firstName+" "+this.lastName;
            }
          }*/
            //计算属性
            computed:{
              fullName:function () {
                console.log("计算了一次")
                return  this.firstName+" "+this.lastName;
              }
            }
          })
      </script>
</body>
</html>